package main

import "fmt"

func main() {

	//变量声明且使用
	var coffeeType string = "Latte"
	var quantity int = 3
	var unitPrice float32 = 4.25

	fmt.Println("Coffee Type:", coffeeType)
	fmt.Println("Quantity:", quantity)
	fmt.Println("Unit Price:", unitPrice)
	fmt.Printf(" Ordered %d %s priced $%.2f each\n", quantity, coffeeType, unitPrice)

	// 变量组，变量声明且使用
	// var (
	// 	customerName string = "Bogdan"
	// 	tableNumber  int    = 8
	// 	isReadyToPay bool   = false
	// )

	// 不赋值，使用默认值，或者先声明，后赋值
	var (
		customerName string
		tableNumber  int
		isReadyToPay bool
	)
	customerName = "Bogdan"
	tableNumber = 8
	isReadyToPay = false

	fmt.Println("Customer Name:", customerName)

	fmt.Println("Table Number:", tableNumber)

	fmt.Println("Is Ready To Pay:", isReadyToPay)
	fmt.Printf("Customer %s at table %d is ready to pay: %t\n", customerName, tableNumber, isReadyToPay)

	// 常量组, 常量可以声明不使用，但是变更不可以，变量必须声明且使用
	// 首字母大写，则可以被其他文件使用
	const (
		SizeSmall = "S"
		SizeMeium = "M"
		SizeLarge = "L"
		SizeCount = 3
	)
	//首字母小写，则只能在本文件中使用
	const (
		sizeSmall = "S"
		sizeMeium = "M"
		sizeLarge = "L"
		sizeCount = 3
	)
}
